<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <title>使用 style 对象</title>
    <style>
        #divAdvert {
            font: 12pt arial;
        }
    </style>
</head>
<body>
<div id="divAdvert">Here is an advertisement.</div>
<script>
    var divAdvert = document.getElementById('divAdvert');
    divAdvert.style.fontStyle = 'italic';
    divAdvert.style.textDecoration = 'underline';
</script>
</body>
</html>